<?php
/**
 * Created by PhpStorm.
 * User: t
 * Date: 2024/3/21
 * Time: 14:07
 * @copyright: ©2024 永州 微聚商网络科技有限公司
 * @link: https://www.wEijuyunke.com
 */
namespace app\admin\controller;

use app\Request;
class Pay
{
   

    

    public function payAmount(){
        $payAmount  = new \app\common\model\PayAmount();
        $list = $payAmount->select();
        $count = $payAmount->count();
        return success('支付金额',['list'=> $list,'count' =>$count ]);
    }
    public  function addPayAmount(Request $request){
        $param  = $request->param();
        $payAmountModel = new \app\common\model\PayAmount();
        $payAmountModel->insert([
            'price' =>  $param['price'],
            'amount' => $param['amount'],
            'give_amount'=> $param['give_amount'],
            'create_time'=> time()]);
        return success('添加成功');
    }

    public  function editPayAmount(Request $request){
        $param  = $request->param();
        $payAmountModel = new \app\common\model\PayAmount();
        $payAmountModel->where(['id' => $param['id']])
            ->update([
                'price' =>  $param['price'],
                'amount' => $param['amount'],
                'give_amount'=> $param['give_amount'],
                ]);
        return success('修改成功');
    }


    public  function setStatus(Request $request){
        $param  = $request->param();
        $payAmountModel = new \app\common\model\PayAmount();
        $payAmountModel->where(['id' => $param['id']])->update(['status' => $param['status']]);
        return success('操作成功');
    }



}